package com.vfa.fishing;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.TextView;
import android.view.View.OnClickListener;

public class EndGameDialog extends Dialog implements OnClickListener
{
	
	ImageButton btnExit;
	ImageButton btnTryAgain;
	TextView tVwLevel;
	Context dlgContext;
	
	public EndGameDialog(Context context) {
		super(context);
		dlgContext = context;
		// TODO Auto-generated constructor stub
		requestWindowFeature(Window.FEATURE_NO_TITLE);  
		setContentView(R.layout.endgame);		
		btnExit = (ImageButton)findViewById(R.id.imgBtnExit);
		btnExit.setOnClickListener(this);
		btnTryAgain = (ImageButton)findViewById(R.id.imgBtnTryAgain);
		btnTryAgain.setOnClickListener(this);
		tVwLevel = (TextView)findViewById(R.id.tVwLevel);
		tVwLevel.setOnClickListener(this);
	}
	
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (v == btnTryAgain) {
			dismiss();
			GameActivity.isTryAgain = true;
		} else if (v == btnExit) {
            int pid = android.os.Process.myPid();
            android.os.Process.killProcess(pid);
            System.exit(0);
		}
		
	}

}
